<?php
echo $javascript->link('ckeditor/ckeditor');
//$config['toolbar'] = array( 
//    array( 'Bold', 'Italic', 'Underline', 'Strike' ), 
//    array( 'Image', 'Link', 'Unlink', 'Anchor' ) 
//); 
$config['height'] = 400;
?>

<div class="news form">
<?php echo $cksource->create(__("News",true),array('url'=>array('plugin'=>'calendar','controller'=>'news','action'=>'add'),'type' => 'file'));?>

	<fieldset>
 		<legend><?php __('Add News'); ?></legend>
	<?php
		echo $this->Form->input('name',array('label'=>__d('calendar','Tytuł',true),'style'=>'width: 100%'));
		echo $this->Form->input('small_content',array('label'=>__d('calendar','Treść do listy',true),'style'=>'width: 100%; height: 60px'));
		echo $this->Form->input('content',array('label'=>__d('calendar','Pełna treść',true),'style'=>'width: 100%; height:120px'));
		echo $cksource->ckeditor('content',array('config'=>$config, 'label'=>__d('calendar','Pełna treść',true),'style'=>'width: 100%;'));
		echo $this->Form->input('on_date',array('label'=>'Data'));
		echo $this->Form->input('NewUpload.0.file', array('type' => 'file','label'=>__d("calendar","Zdjęcie",true)));
		echo $this->Form->input('url',array('label'=>__d('calendar','Adres URL',true),'style'=>'width: 100%'));
		echo $this->Form->input('new_group_id',array('label'=>'Type','options'=>$newsGroups));
	?>
	</fieldset>
<?php echo $this->Form->end(__('Submit', true));?>
</div>


<?php if($session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'admin' || $session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'manag'){?>

<?php $this->Footpanel->install();?>
<div id="footpanel">
	<ul>
		<li><?php echo $this->Html->link(__('Home', true).'<small>'.__('Home', true).'</small>', array('plugin'=>'calendar','controller'=>'news','action'=>'index'),array('escape'=>false,'class'=>'home')); ?></li>
		<li><?php echo $this->Html->link(__('Add News', true).'<small>'.__('Add News', true).'</small>', 
			array('plugin'=>'calendar','controller'=>'news','action'=>'add'),
			array('escape'=>false,'style'=>'background-image: url(/img/firma/actions_16_add.png)')); ?></li>					
	</ul>
</div>
<?php }?>